package vow.gui.renderer;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

public class StringEntryRenderer extends JLabel implements ListCellRenderer{

	public StringEntryRenderer(){
		setAutoscrolls(true);
        setOpaque(true);
	}
	
	@Override
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
		if(isSelected){
            setBackground(Color.cyan);
        }
        else
        	if((index % 2)==0)
        		setBackground(Color.lightGray);
        	else
        		setBackground(Color.white);
		setText((String)value);
		return this;
	}
	
}